package com.site.model.dining;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "t_news_sort")
public class NewsSortInfo implements Serializable {

	private static final long serialVersionUID = 1L;
	private Long id;
	private String name;
	private String intro;
	private List<NewsAdvisoryInfo> newsAdvisoryInfos;

	@Id
	@GeneratedValue
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "INTRO")
	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	@OneToMany(mappedBy = "type", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	public List<NewsAdvisoryInfo> getNewsAdvisoryInfos() {
		return newsAdvisoryInfos;
	}
	public void setNewsAdvisoryInfos(List<NewsAdvisoryInfo> newsAdvisoryInfos) {
		this.newsAdvisoryInfos = newsAdvisoryInfos;
	}
}
